for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
jQuery(document).ready(function() {
if( typeof wpapi_gmaps !== 'undefined' ){
wpapi_gmaps
/** global: wpapi_gmaps */
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.
google.maps.event.addDomListener(window, 'load', initialize_map );
google
/** global: google */
}
});
// Initialize map
function initialize_map() {
wpapi_gmaps.forEach(function(single_gmap, index){
var mapCanvas = document.getElementById('wpapi-gmap-' + index);
var myLatLng = new google.maps.LatLng( single_gmap.lat , single_gmap.lng );
var map_style = JSON.parse(single_gmap.style);
var map_zoom = single_gmap.scrollwheel ? false : true;
var mapOptions = {
center: myLatLng,
zoom: Number(single_gmap.zoom),
scrollwheel: map_zoom,
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles: map_style
var marker = new google.maps.Marker({
position: myLatLng
var infoContent = single_gmap.info;
var infowindow = new google.maps.InfoWindow({
content: infoContent
var map = new google.maps.Map(mapCanvas, mapOptions);
marker.setMap(map);
infowindow.open(map, marker);
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.